package net.csdn.business.notify.feign;


import net.csdn.business.notify.common.constant.ServiceNameConstants;
import net.csdn.business.notify.common.model.dto.UserFansCheckDTO;
import net.csdn.business.notify.common.model.dto.UserRoleDTO;
import net.csdn.business.notify.common.model.vo.UserInfoVO;
import net.csdn.business.notify.feign.decoder.SystemFeignErrorDecoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Auther: zhangyalei
 * @Date: 2022/12/21 16:59
 * @Description:
 */
@FeignClient(value = ServiceNameConstants.ATOMGIT_SYSTEM_SERVICE, contextId = ServiceNameConstants.ATOMGIT_SYSTEM_AUDIT_CONTEXT_ID, configuration = SystemFeignErrorDecoder.class)
public interface SystemFeignClient {


    /**
     * @Desc: 批量查询用户信息
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/user/batchQuery")
    public Map<String, UserInfoVO> batchQuery(@RequestBody List<String> userIds);


    /**
     * @Desc: 批量查询项目成员信息
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @GetMapping("/api/v1/project/memberAll/{projectId}")
    public List<UserInfoVO>  getProjectMemberAll(@PathVariable("projectId") String projectId);


    /**
     * @Desc: 查询项目的的成员角色
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/project/getAccessLevel")
    public Integer getProjectAccessLevel(@RequestBody UserRoleDTO params);


    /**
     * @Desc: 批量查询组织成员信息,最多100个
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @GetMapping("/api/v1/org/memberAll/{orgId}")
    public List<UserInfoVO> getOrgMemberAll(@PathVariable("orgId") String orgId);

    /**
     * @Desc: 查询组织的成员角色
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/org/getAccessLevel")
    public Integer getOrgAccessLevel(@RequestBody UserRoleDTO params);



    @PostMapping("/api/v1/user/fans/check")
    public Boolean fansCheck(@RequestBody UserFansCheckDTO params);


}